/* GUI CONVERTED from ecpsfm01.p (converter v1.75) Mon Aug 14 12:27:52 2000 */
/* ecpsfm01.p - BOM SUMMARY SUB-ROUTINE: Create psmstr Work File         */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                   */
/* All rights reserved worldwide.  This is an unpublished work.          */
/* web convert ecpsfm01.p (converter v1.00) Mon Oct 06 14:21:50 1997 */
/* web tag in ecpsfm01.p (converter v1.00) Mon Oct 06 14:18:05 1997 */
/*K0M7*/ /*V8#ConvertMode=WebReport                            */
/*V8:ConvertMode=Report                                                  */
/* REVISION: 7.4       LAST EDIT: 04/20/95      MODIFIED BY: QZL *H0DB*  */
/* REVISION: 8.6       LAST EDIT: 10/08/97      MODIFIED BY: mzv *K0M7*  */
/* REVISION: 8.6       LAST EDIT: 05/29/98      MODIFIED BY: *K1R6* A.Shobha */
/* REVISION: 8.6   LAST MODIFIED: 01/28/99      BY: *K1Z2* Santhosh Nair */
/* REVISION: 9.1   LAST MODIFIED: 08/14/00      BY: *N0KW* Jacolyn Neder     */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

     {mfdeclre.i}
/*K1R6 /*K0M7*/ {wbrp02.i} */


     define input parameter ecmnbr like ecm_nbr.
     define input parameter comp like ps_comp.
/*K1Z2** BEGIN DELETE **
 *   define shared workfile psmstr like ps_mstr.
 *   define shared variable maxwkfl as integer.
 *   define shared variable wkfl_no as integer.
 *K1Z2** END DELETE */
/*K1Z2*/ define shared temp-table psmstr like ps_mstr.
     for each psmstr exclusive-lock:
        delete psmstr.
     end.

     /* TOP PARENT ITEM IS EXPLOSED HERE TO CREATE STRUCTURE WORK  */
     /* FILES BASED ON LIVE STRUCTURE. ASSOCIATED STRUCTURES ON    */
     /* PREVIOUS RELEASED ECNS AND THIS ECN ARE ALSO CREATED.      */
     {gprun.i ""ecpsfm03.p"" "(input comp, input ecmnbr)"}

     /* THIS BLOCK CONTINUES EXPLOSION OF STRUCTURES THAT ARE NEW  */
     /* IN LIVE DATABASE AND MAKES SURE THAT ANY LIVE STRUCTURE    */
     /* UNDER ECN COMPONENT IS ALSO CONSIDERED.                    */
     block-a:
     for each ecd1_det where ecd1_nbr = ecmnbr and not ecd1__qad01 and
     not can-find(first ps_mstr where ps_mstr.ps_par = ecd1_par and
     ps_mstr.ps_comp = ecd1_comp) no-lock:

        find first psmstr where psmstr.ps_par = ecd1_par and
        psmstr.ps_comp = ecd1_comp and psmstr.ps_ref = ecd1_ref
        no-lock no-error.
        if available psmstr then next.

        {gprun.i ""ecpsfm04.p"" "(input recid(ecd1_det), input ecmnbr)"}

        find first psmstr where (psmstr.ps_par = ecd1_par or
        psmstr.ps_comp = ecd1_par) no-error.
        if available psmstr then do:
           {gprun.i ""ecpsfm03.p"" "(input ecd1_comp, input ecmnbr)"}
           next block-a.
        end.
     end.
/*K1R6 /*K0M7*/ {wbrp04.i}*/
